Using Static Analysis to Derive Imperative Code from ALPHA
نویسندگان
چکیده
In this article, we demonstrate a translation methodology which transforms a high level algorithmic speciication written in the Alpha language to an imperative data parallel language. Alpha is a functional language which was designed to facilitate the kinds of static analyses needed for doing regular array synthesis. We show that the same methods which are used for solving regular array synthesis problems can be applied to the compilation of Alpha as a functional language. We informally introduce the Alpha language with the aid of examples and explain how it is adapted to doing static analysis and transformation. We rst show how an Alpha program can be naively implemented by viewing it as a set of monolithic arrays and their lling functions, implemented using applicative caching. We then show how static analysis can be used to improve the eeciency of this naive implementation by orders of magnitude. We present a compilation method which makes incremental transformations on the abstract syntax tree of an Alpha program in order to make performance improvements and optimize it for a given architecture. The compilation steps described include scheduling, alignment, partitioning, allocation, loop nest generation, and code generation and they are illustrated with a running example. We discuss some of the static analysis issues which come up at each of these steps and brieey describe what static analysis tools are used. L'application de l'analyse statique a la derivation de code d'un programme fonctionnel R esum e : Ce papier pr esente une m ethodologie de transformation d'une sp eciication algorithmique de haut niveau cod ee en Alpha en un langage imp eratif a parall elisme de donn ees. Alpha est un langage fonctionnel d edi e aux types d'analyse statique requis pour la synth ese de r eseaux r eguliers. Nous montrons que les m ethodes de r esolution des probl emes li es a la synth ese de r eseaux r eguliers peuvent ^ etre appliqu ees a la compilation de Alpha en tant que langage fonctionnel. Pour cela, apr es avoir introduit de mani ere informelle le langage Alpha, son adaptation a l'analyse statique et aux transformations de programmes est explicit ee. Ensuite, nous pr esentons une impl ementation na ve d'un programme Alpha sous forme d'un ensemble de tableaux monolithiques dont les fonctions de remplissage font appel a la technique de cache applicative. Gr^ ace a l'analyse statique, l'eecacit e de cette premi …
منابع مشابه
Using Static Analysis to Derive Imperative Code from Alpha Patrice Quinton, Sanjay Rajopadhye, Doran Wilde
In this article, we demonstrate a translation methodology which transforms a high level algorithmic speciication written in the Alpha language to an imperative data parallel language. Alpha is a functional language which was designed to facilitate the kinds of static analyses needed for doing regular array synthesis. We show that the same methods which are used for solving regular array synthes...
متن کاملOn deriving data parallel code from a functional program
We discuss a translation methodology for transforming a high level algorithmic speciication written in Alpha to an imperative data parallel language. We informally introduce the Alpha language with the aid of an example and explain how it is adapted for doing static analysis and transformation. An Alpha program can be naively compiled 11] using applicative caching. Our compilation method makes ...
متن کاملGeometric Quantifier Elimination Heuristics for Automatically Generating Octagonal and Max-plus Invariants
Geometric heuristics for the quantifier elimination approach presented by Kapur (2004) are investigated to automatically derive loop invariants expressing weakly relational numerical properties (such as l ≤ x ≤ h or l ≤ ±x ± y ≤ h) for imperative programs. Such properties have been successfully used to analyze commercial software consisting of hundreds of thousands of lines of code (using for e...
متن کاملEnabling Operator Reordering in Data Flow Programs Through Static Code Analysis
In many massively parallel data management platforms, programs are represented as small imperative pieces of code connected in a data flow. This popular abstraction makes it hard to apply algebraic reordering techniques employed by relational DBMSs and other systems that use an algebraic programming abstraction. We present a code analysis technique based on reverse data and control flow analysi...
متن کاملApplying static code analysis to firewall policies for the purpose of anomaly detection
Treating modern firewall policy languages as imperative, special purpose programming languages, in this article we will try to apply static code analysis techniques for the purpose of anomaly detection. We will first abstract a policy in common firewall policy language into an intermediate language, and then we will try to apply anomaly detection algorithms to it. The contributions made by this...
متن کامل